//
//  HDHelpCenterTableViewController.m
//  HDecoration
//
//  Created by 曹群 on 15/8/17.
//  Copyright (c) 2015年 HDecoration. All rights reserved.
//

#import "HDHelpCenterTableViewController.h"
#import "HDWebViewController.h"

@interface HDHelpCenterTableViewController ()
@property(nonatomic,strong)NSArray *helpCenterUrls;
@end

@implementation HDHelpCenterTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.helpCenterUrls = @[[NSString stringWithFormat:@"%@/sktPicture/sysPicture/bm.png",netEngine.httpUrl],
                            [NSString stringWithFormat:@"%@/sktPicture/sysPicture/action.png",netEngine.httpUrl],
                            [NSString stringWithFormat:@"%@/sktPicture/sysPicture/ks.png",netEngine.httpUrl],
                            [NSString stringWithFormat:@"%@/sktPicture/sysPicture/lc.png",netEngine.httpUrl],
                            [NSString stringWithFormat:@"%@/sktPicture/sysPicture/xc.png",netEngine.httpUrl]];
}

#pragma mark - Table view data source

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    HDWebViewController *helperWebview = [[HDWebViewController alloc] init];
    helperWebview.titleStr = @"帮助中心";
    helperWebview.urlStr = self.helpCenterUrls[indexPath.row];
    [rootNavigation pushViewController:helperWebview animated:YES];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.dataArray.count+1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *identify = @"helpInfoCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identify];
    if (cell==nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identify];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.textLabel.font = [UIFont systemFontOfSize:15];
    }
    if (indexPath.row==self.dataArray.count) {
        cell.textLabel.text = @"";
    } else {
        cell.textLabel.text = self.dataArray[indexPath.row];
    }
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 50;
}

@end
